package com.林子祺.全名健康管理系统.entity.article.content.comment;

import com.林子祺.全名健康管理系统.entity.article.content.article.CurrentIndexData;
import com.林子祺.全名健康管理系统.util.ArticleStructure;
import com.林子祺.全名健康管理系统.util.CommentStructure;

import java.util.ArrayList;

public class CommentData {

    static ArrayList<CommentStructure> cs = new ArrayList<>();

    public static void InputData(String username,String articleName, String comment){
        cs.add(new CommentStructure(username,articleName,comment));
    }


    public static boolean OutputCommentData(int number){
        if(number < cs.size()){
            CommentStructure p = cs.get(number);
            CurrentCommentData.username = p.getUsername();
            CurrentCommentData.articleName = p.getArticleName();
            CurrentCommentData.comment = p.getComment();
            return true;
        }
        else
            return false;
    }

    public static void Refresh(){
        if(cs.size() != 0)
            cs.removeAll(cs);
    }
}
